using System;
using System.Collections.Generic;
using System.Text;
using QLPMT_DTO;
using System.Data.SqlClient;

namespace QLPMT_DAO
{
   public class HePhanQuyenDAO
    {
       DataProvider Provider;
       public HePhanQuyenDAO()
       {
           Provider = new DataProvider();
       }
       public List<HePhanQuyen> GetAll()
       {
           Provider.Connect();
           string sql = "select *  from  HePhanQuyen ";
           SqlDataReader reader = Provider.ExecuteReader(sql);
           List<HePhanQuyen> list = new List<HePhanQuyen>();
           while (reader.Read())
           {
               string ma = reader.GetString(0);
               string ten = reader.GetString(1);
               HePhanQuyen dto = new HePhanQuyen(ma, ten);
               list.Add(dto);
           }
           Provider.Disconnect();
           return list;
       }
    }
}
